import { HttpServiceResponse, Service } from '../core';

class SecurityService extends Service {
	protected create(): SecurityService {
		return this.initTokenInstance('security') as SecurityService;
	}

	authentication = (): Promise<HttpServiceResponse<void>> =>
		this.request({
			method: this.method.POST,
			url: '/authentication',
		});

	authorization = (authorities: string[]): Promise<HttpServiceResponse<void>> =>
		this.request({
			method: this.method.POST,
			url: '/authorization',
			data: authorities,
		});
}

export const securityService = new SecurityService();
